<?php

namespace App\Http\Requests\Entity\Assets;

use Illuminate\Foundation\Http\FormRequest;

class AssetStreamRequest extends FormRequest
{

    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        switch($this->method())
        {
            case 'GET':
            case 'DELETE':
            {
                return [];
            }
            // Crate
            case 'POST':
            {
                return [
                    'spid' => 'required|max:50',
                    'asset_type' => 'required',
                    'spasset_id' => 'required',
                    'spassetkit_id' => 'max:200',
                    'title' => 'required',
                    'subtitle' => 'max:200',
                    'short_desc' => 'max:1000',
                    'long_desc' => 'max:1000',
                    'vcat_id' => 'required',
                    'pid' => 'max:200',
                    'subvcat_id' => 'max:200',
                    'directors' => 'max:200',
                    'actors' => 'max:200',
                    'vlang' => 'max:200',
                    'serials' => 'max:200',
                    'sp_file_id' => 'max:200',
                    'file_url' => 'max:200',
                    'duration' => 'max:200',
                    'vformat' => 'max:200',
                    'tags' => 'max:200',
                    'resolutions' => 'max:200',
                    'vbitate' => 'max:200',
                    'mediatype' => 'max:200',
                    'pic0' => 'max:200',
                    'pic1' => 'max:200',
                    'pic2' => 'max:200',
                    'pic3' => 'max:200',
                    'pic4' => 'max:200',
                    'pic5' => 'max:200',
                    'pinyin' => 'max:200',
                    'score' => 'max:200',
                    'varea' => 'max:200',
                    'vyears' => 'max:200',
                    'episode' => 'max:200',
                    'upto' => 'max:200'
                ];
            }
            // UPDATE
            case 'PUT':

            case 'PATCH':
            {
                $id = $this->route('assets');
                return [
                    'spid' => 'required|max:50',
                    'asset_type' => 'required',
                    'spasset_id' => 'required',
                    'spassetkit_id' => 'max:200',
                    'title' => 'required',
                    'subtitle' => 'max:200',
                    'short_desc' => 'max:200',
                    'long_desc' => 'max:200',
                    'vcat_id' => 'required',
                    'pid' => 'max:200',
                    'subvcat_id' => 'max:200',
                    'directors' => 'max:200',
                    'actors' => 'max:200',
                    'vlang' => 'max:200',
                    'serials' => 'max:200',
                    'sp_file_id' => 'max:200',
                    'file_url' => 'max:200',
                    'duration' => 'max:200',
                    'vformat' => 'max:200',
                    'tags' => 'max:200',
                    'resolutions' => 'max:200',
                    'vbitate' => 'max:200',
                    'mediatype' => 'max:200',
                    'pic0' => 'max:200',
                    'pic1' => 'max:200',
                    'pic2' => 'max:200',
                    'pic3' => 'max:200',
                    'pic4' => 'max:200',
                    'pic5' => 'max:200',
                    'pinyin' => 'max:200',
                    'score' => 'max:200',
                    'varea' => 'max:200',
                    'vyears' => 'max:200',
                    'episode' => 'max:200',
                    'upto' => 'max:200'
                ];
            }
            default:
                break;
        }
    }
}
